Working With Data References
Media structures identify how and where to find their sample data by means of data references. For sound and video media, data references identify files that contain media data; the media data is stored in the data forks of these files. Media handlers use these data references in order to manipulate media data. A single media may contain one or more data references.Each data reference contains type information that identifies how the reference is specified. Most QuickTime data references use alias information to locate the corresponding files (see Inside Macintosh: Files for more information about aliases and the Alias Manager). The type value for data references that use aliases is
'alis'
. Note that the Movie Toolbox uses aliases even on Macintosh computers that do not have System 7 installed--your application can use Alias Manager routines if the Movie Toolbox is installed. See "The Movie Toolbox and System 6" on page 2-54 for more information.The Movie Toolbox identifies a media's data references with an index value. Index values always range from 1 to the number of references in the media. Data reference indexes provide a convenient way to access each reference in a media.
The Movie Toolbox provides a set of functions that allow you to work with data references. This section describes those functions.
You can use the
GetMediaDataRef
function to retrieve information about a media's data reference. You can add a data reference to a media by calling theAddMediaDataRef
function. TheSetMediaRef
function lets you change which file a specified media associates with its data storage.Your application can determine the number of data references in a media by calling the
GetMediaDataRefCount
function.
Subtopics
- AddMediaDataRef
- SetMediaDataRef
- GetMediaDataRef
- GetMediaDataRefCount